<template>
  <div class="cart-bottom-bar">
    <!-- <el-button>全选</el-button> -->
    
      <div>总价格{{totalPrice}}</div>
      <el-button type="danger" plain>去付款{{tatalNum}}</el-button>
    
    
  </div>
</template>

<script>
export default {
  name:"cartBottomBar",
  computed: {
    totalPrice() {
      var cartlist = this.$store.state.cartList
      return cartlist.filter(item => {
        return item.statezzz === true
      }).reduce((preValue, item) => {
        return parseFloat(preValue) + parseFloat(item.price)
      },0)
    },
    totalNum() {
      var cartlist = this.$store.state.cartList
      return cartlist.filter(item => {
        return item.statezzz === true
      }).length
    }
  }
}
</script>

<style scoped>
.cart-bottom-bar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 49px;
  height: 49px;
  line-height: 49px;
  background-color: #f2f2f2;
  display: flex;
  justify-content: space-between;
}



</style>